# encoding: utf-8
class Cartao < ActiveRecord::Base
  attr_protected
  
  validates :dia_vencimento, :digitos, :descricao,
  	:presence => true

  validates :dia_vencimento,
  	:numericality => { :less_than_or_equal_to => 31,
										  	:greater_than => 0,
										  	:only_integer => true }

	validates :digitos,
		:length => { :is => 4 },
		:numericality => { :less_than_or_equal_to => 9999,
												:greater_than => 0,
												:only_integer => true }
end
